<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <div id="app">
        <h3>商品数量：{{count}}</h3>
        <h3>商品单价：{{price}}</h3>
<!--        <h3>商品总价：{{totalPrice()}}</h3>-->
        <h3>商品总价：{{totalPrice}}</h3>

    </div>

    <script src="js/vue.js"></script>
    <script>
        new Vue({
            el:"#app",
            data:{
                count:10,
                price:5,
            },
            computed:{
                totalPrice(){
                    return this.count * this.price;
                }
            }
            // methods:{
            //     totalPrice(){
            //         return this.count * this.price;
            //     }
            // }
        })
    </script>
</body>
</html>